package ch02_data.enums;

/**
 * 自定义枚举类转枚举类
 *
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public enum Self2Enum {
    // 1、提供当前的枚举对象，多个对象直接使用逗号，末尾用；
    SPRING("春天", "春暖花开"),
    SUMMER("夏天", "春暖花开");

    // 1、声明对象属性，private final
    private final String seasonName;
    private final String seasonDesc;

    // 2、私有化构造方法，给属性赋值
    private Self2Enum(String seasonName, String seasonDesc) {
        this.seasonName = seasonName;
        this.seasonDesc = seasonDesc;
    }


    // 4、枚举类对象属性
    public String getSeasonName() {
        return seasonName;
    }

    public String getSeasonDesc() {
        return seasonDesc;
    }

    // 5、toString
    @Override
    public String toString() {
        return "SelfEnum：{" +
                "seasonName='" + seasonName + '\'' +
                ", seasonDesc='" + seasonDesc + '\'' +
                '}';
    }

    // main测试
    public static void main(String[] args) {
        System.out.println(Self2Enum.SUMMER);
        // 父类不是Object对象
        System.out.println(Self2Enum.class.getSuperclass());
    }
}
